package com.copa.module.order.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.copa.domain.ResponseDto;
import com.copa.module.order.domain.dto.OrderListDto;
import com.copa.module.order.domain.entity.OrderEntity;
import com.copa.module.order.domain.vo.OrderListVo;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * @author copa
 * @createDate 2021-01-09
 * @function t_order表 Mapper 接口
 */
@Mapper
public interface OrderDao extends BaseMapper<OrderEntity> {

    IPage<OrderListDto> findOrderList(@Param("orderListDtoIPage") IPage<OrderListDto> orderListDtoIPage
            , @Param("orderListVo") OrderListVo orderListVo);

    IPage<OrderListDto> findOrderListByApplyRefund(@Param("page") Page<OrderListDto> page, @Param("orderListVo") OrderListVo orderListVo);

    Long findAddTotalOrderNumByTime(@Param("now") LocalDate now, @Param("yesterday") LocalDate yesterday);

    Long findAddOrderGoodsNumByTime(@Param("now") LocalDate now, @Param("yesterday") LocalDate yesterday);

    Long findAddPayTotalOrderNumByTime(@Param("now") LocalDate now, @Param("yesterday") LocalDate yesterday);

    Long findAddPayOrderGoodsNumByTime(@Param("now") LocalDate now, @Param("yesterday") LocalDate yesterday);

    Long findRefundOrderGoodsNumByTime(@Param("now") LocalDate now, @Param("yesterday") LocalDate yesterday);

    BigDecimal findIncomeByTime(@Param("now") LocalDate now, @Param("yesterday") LocalDate yesterday);

    BigDecimal findRefundByTime(@Param("now") LocalDate now, @Param("yesterday") LocalDate yesterday);

    Long findAddSaleGoodsNumByTime(@Param("now") LocalDate now, @Param("yesterday") LocalDate yesterday);

    Long findRefundSaleGoodsNumByTime(@Param("now") LocalDate now, @Param("yesterday") LocalDate yesterday);
}
